//
//  Contentmanager.m
//  Void Dead
//
//  Created by Sidney Just on 14.09.09.
//  Copyright 2009 by Sidney Just
//  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; 
//  either version 3 of the License, or (at your option) any later version.
//  
//  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty 
//  of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
//  

#import "Contentmanager.h"

@implementation VD_ContentManager

- (id)initWithEngine:(VD_Engine *)eng {
	if(self = [super init])
	{
		panMan = eng.panManager;
		texMan = eng.texManager;
		lblMan = eng.lblManager;
	}
	return self;
}

- (void)dealloc {
	[super dealloc];
}

#pragma mark -
#pragma mark Panel

- (VD_ParticleEmitter *)createParticleEmitter {
	return [panMan createParticleEmitter];
}

- (VD_Panel *)createPanel:(int)layer {
	return [panMan createPanel:layer];
}

- (VD_Animation *)createAnimation:(VD_Panel *)pan withStart:(float)startPoint End:(float)endPoint Speed:(float)speed Size:(float)tileSize andLeap:(float)leap {
	return [panMan createAnimation:pan withStart:startPoint End:endPoint Speed:speed Size:tileSize andLeap:leap];
}

- (void)updatePanel:(VD_Panel *)pan withAtlas:(BOOL)at forAnimation:(VD_Animation *)anim {
	[panMan updatePanel:pan withAtlas:at forAnimation:anim];
}

- (VD_Panel *)isTouchInPanel:(CGPoint)pos {
	return [panMan isTouchInPanel:pos];
}

- (VD_Panel *)isTouchInPanel:(CGPoint)pos andInLayer:(int)layer {
	return [panMan isTouchInPanel:pos andInLayer:layer];
}

- (void)deleteParticleEmitter:(VD_ParticleEmitter *)emit {
	[panMan deleteParticleEmitter:emit];
}

- (void)deletePanel:(VD_Panel *)pan {
	[panMan deletePanel:pan];
}

- (void)deleteAnimation:(VD_Animation *)ani {
	[panMan deleteAnimation:ani];
}

- (VD_Panel *)p_trace:(CGPoint)start :(CGPoint)end {
	return [panMan p_trace:start :end];
}

- (VD_Panel *)nextPanel:(VD_Panel *)pan {
	return [panMan nextPanel:pan];
}

- (void)createDefaultShape:(VD_Panel *)pan {
	[panMan createDefaultShape:pan];
}

#pragma mark -
#pragma mark texture 

- (int)loadATexture:(NSString *)str {
	return [texMan loadATexture:str];
}

- (void)deleteTexture:(NSString *)str {
	return [texMan deleteTexture:str];
}

#pragma mark -
#pragma mark label

- (VD_label *)createLabel {
	return [lblMan createLabel];
}

- (void)deleteLabel:(VD_label *)lbl {
	[lblMan deleteLabel:lbl];
}


@end
